<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="thx" uri="/thx-tags"%>
<%@ taglib prefix="fun" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>



<section class="content">
	<div class="row">
		<div class="col-md-12">
			<div class="box-header with-border">
				<div class="row">
					<form class="search-panel" action="addressbook/addressbook!list.action" name="search-form" result-container=".right">
						<input type="hidden" name="pid" value="${pid}">
						<input type="text" class="form-control" placeholder="请输入人员名称" name="searchName" value="${searchName}">
						<button type="button" class="btn btn-primary search-btn">搜索</button>
					</form>
				</div>
			</div>
			<div class="box-body no-padding">
				<div class="row">
					<div class="col-sm-12">
						<table class="table table-bordered">
							<tr>
	  							<th>姓名</th>
	                            <th>性别</th>
	                            <th>职务</th>
	                            <th>手机</th>
	                            <th>集团小号</th>
	                            <th>电子邮件</th>
	                            <th>操作</th>								
							</tr>
							<c:if test="${empty list}">
								<tr>
									<td colspan="7">暂无数据！</td>
								</tr>
							</c:if>
							<c:forEach items="${list}" var="e">
								<tr>
									<td>${e.addressbookName}</td>
									<td><c:if test="${e.addressbookSex=='1'}">男</c:if><c:if test="${e.addressbookSex=='0'}">女</c:if></td>
									<td>${e.addressbookDuty}</td>
									<td>${e.addressbookMobile}</td>
									<td>${e.addressbookShortmobile}</td>
									<td>${e.addressbookMail}</td>
									<td>
										<button type="button" 
											title="修改" 
											data-toggle="tooltip"
											data-placement="bottom"
											open-url="addressbook/addressbook!input.action?pid=${pid}&id=${e.priId}"
											class="btn btn-default btn-sm btn-open-form">
											<i class="fa fa-edit"></i>
										</button>
										<button type="button"
											title="删除" 
											data-toggle="tooltip"
											data-placement="bottom"
											do-url="addressbook/addressbook!delete.action?pid=${pid}&id=${e.priId}"
											load-url="addressbook/addressbook!list.action?pid=${pid}" load-container="div.right"
											confirm-msg="确定要删除吗？"
											class="btn btn-default btn-sm btn-open-confirm-win">						
											<i class="fa fa-trash"></i>
										</button>
									</td>
								</tr>
							</c:forEach>
						</table>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<!--分页区-->
				<div class="pagePanel">
					<thx:pages pageNo="page.curPage" total="page.totalPage" theme="number">
						<s:param name="searchName" value="searchName"></s:param>
					</thx:pages>
				</div>
				<!--底部操作区-->
				<div class="handlePanel">
					<a title="新增人员" open-url="addressbook/addressbook!input.action?pid=${pid}"
						class="a-btn btn-open-form"> <span class="fa fa-plus"></span>
						<span class="text">新增</span>
					</a>
				</div>
			</div>
		</div>
	</div>
</section>
<script>
	require([ 'list','thx-page'], function(list, page) {
		list.init();
		page.init(".right");	
	});
</script>

